package cn.tedu.net.innerclass;

import org.junit.Test;

//本类用于测试匿名内部类,匿名内部类没有名字通常结合着匿名对象进行使用
public class TestInner5 {
    @Test
    public void run() {
      Inner1 inner1  =  new Inner1(){
         @Override
         public void get() {
             System.out.println("你是一个傻逼");
         }

         @Override
         public void sava() {
             System.out.println("你存了一个傻逼知识点");
         }
     };
      inner1.get();
      inner1.sava();
      Inner2 inner2 =new Inner2() {
          @Override
          public void eat(String a, String b) {
              System.out.println(a+"喜欢吃"+b);
          }
      };
      inner2.play();
      inner2.eat("程晓宇","屎");
      Inner3 inner3 =new Inner3();
      inner3.hot();
      inner3.sleep();
    }
}